import request from '@/utils/request'

export function studentList(obj) {
  return request({
    url: '/sys/class_student/students',
    method: 'get',
    params: obj
  })
}
/**
 * 新增学生
 * <pre>
 * {
    "classId": 4,
    "nickname": "张家敏ee",
    "sex": 0,
    "idCard": "440102198001021230",
    "concat": "18925800000",
    "familyConcat": "18925800000",
    "origin": "广东东莞",
    "address": "广东省东莞市火星街"
  }
 * </pre>
 * @param {Object} data
 */
export function addStudent(data) {
  return request({
    url: '/sys/user/add',
    method: 'post',
    data
  })
}
/**
 * <pre>
 * {
    // 学生 id 这个是必需的
    "studentId": 15,
    // 班级 id，如果传入，修改班级的关联 - 可以做调班的作用
    "classId": 4,
    "nickname": "小高",
    "idCard": "440102198001021230",
    "concat": "18925800000",
    "familyConcat": "18925800000",
    "origin": "广东东莞",
    "address": "广东省东莞市水星街",
    "position": "班长"
  }
 * </pre>
 * @param {Object} data
 */
export function editStudent(data) {
  return request({
    url: '/sys/user/edit',
    method: 'post',
    data
  })
}

/**
 * 删除学生
 * @param {学生id} id
 */
export function delStudent(id) {
  return request({
    url: '/sys/user/delete/' + id,
    method: 'get'
  })
}

